# Application development ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- This document describes how to develop applications on the Debian system of Quectel Pi H1. Application development refers to the process of writing, compiling, and running applications on the development board. Quectel Pi H1 supports two development approaches: - **Local Development**: Develop, compile, and run directly on the development board, suitable for rapid development and debugging - **Cross-Compilation**: Compile code on a PC host to generate executable files that can run on the development board, suitable for resource-constrained scenarios or when higher compilation efficiency is needed This document uses the classic HelloWorld program as an example to detail the complete workflow of both development approaches, helping developers quickly get started with application development on Quectel Pi H1. # HelloWorld Example HelloWorld is a simple C program primarily used to verify that the development environment is set up correctly. By writing, compiling, and running this basic program, you can test the basic functionality of the system, including whether the compiler, runtime environment, etc., are working properly. It is a fundamental practice for getting started with embedded development. ## Local Development Local development refers to developing, compiling, and running directly on the Quectel Pi H1 development board. This approach is simple to operate and suitable for quick verification and debugging. ### Setting Up the Development Environment After logging into the Debian system of Quectel Pi H1, open a terminal window, enter the following command and press Enter to install the necessary development environment: ```bash sudo apt update && sudo apt install vim gawk gcc g++ build-essential chrpath socat wget diffstat file unzip tar locales zstd debianutils iputils-ping cpio python3 python3-pip net-tools git make cmake ``` ### Writing Code 1. Create a **helloworld.c** file in the **/Desktop** directory. 2. Copy the following code snippet and paste it into the **helloworld.c** file: ```c #include int main(void){printf("hello world\r\n");return 0;} ``` ### Compiling and Running 3. Execute the following command to compile the code: ```shell $ cd Desktop/ $ gcc helloworld.c -o helloworld ``` 4. Execute the following command to run the helloworld program: ```shell $ ./helloworld ``` 5. Program execution result output: ```shell $ ./helloworld $ hello world ``` ## Cross-Compilation Cross-compilation is the process of generating executable programs on one platform (such as an x86 PC) that can run on another platform with a different architecture (such as an ARM embedded device). This approach allows compilation on more powerful PCs, improving development efficiency. ### Prerequisites - A 32/64-bit host computer for compiling code. - A Quectel Pi H1 development board for running the executable program. Using a 64-bit computer as an example, execute the following steps on the host: ### Installing ARM64 Toolchain ```bash sudo apt update sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu ``` ### Verifying Installation ```bash $ aarch64-linux-gnu-gcc --version ``` ```{image} images/image_VnzubQLpQoyx0ixffxscBtq6nLd.webp :width: 624px :height: 100px ``` ### Creating Code File ```bash $ touch hello.c $ sudo vim hello.c ``` Press **ESC + i**, enter the following code, then press **ESC + "shift + : "**, and type "**wq+Enter**" in the command console to save and exit. ```c #include int main() {printf("Hello World!\n");return 0;} ``` ```{image} images/image_BZ3tbtv2bozO1CxI4Pfc98yznnb.webp :width: 596px :height: 325px ``` ### Compiling Code File ```bash $ aarch64-linux-gnu-gcc -o output_filename source_filename Example: aarch64-linux-gnu-gcc -o hello_arm64 hello.c ``` ### Checking File Architecture ```bash $ file filename ``` Successful compilation is shown as follows: ```{image} images/image_DBdzb0fENoYjZQx1az5cjjyFn1g.webp :width: 1071px :height: 60px ``` ### Uploading Compiled File Download the compiled file from the host to your local machine, then upload the compiled file to the Quectel Pi H1 development board using the SCP command in the Windows console. ```bash #Note: Do not use Chinese characters in the file path where the compiled file is stored on the hostscp -O /local/file.txt username@remote_IP:/target_path/ Example: scp -O D:\hello_arm64 pi@192.168.x.x:/home/pi ``` ```{image} images/image_WSPpbkedMoQugJxhOKacF2pRnrh.webp :width: 1054px :height: 80px ``` ### Running Compiled File Set permissions for the compiled file and execute it on the Quectel Pi H1 development board terminal. ```bash sudo chmod 777 filename ``` ```{image} images/image_M56XbYFkRo7xvSxXHZMcz4SQnAi.webp :width: 342px :height: 49px ```